
<div class="hd">
	<div class="hd_content">

		<span> 权限用户组  </span>

	</div>
</div>
<div class="container " id="usergroup" tar="${s.base}/admin/depts_json">
	<div class="nav_items_lay scroll tree_body">
		<ul class='tree_content tree_bd'>
		</ul>
	</div>

</div>
<script type="text/javascript" src="${s.base}/res/js/treenode.js"></script>
<link rel="stylesheet" href="${s.base}/res/css/treenode.css">
<style>
.tree_content .tree_item .ti_desc:after {
	content: "\f105";
 
	float: right;
	margin-top: -40px;
	background-color: rgba(255, 254, 254, 0.42);
	width: 24px;
	height: 24px;
	line-height: 26px;
	margin-right: 10px;
	border-radius: 30px;
	color: rgb(241, 241, 241);
	text-align: center;
    font-size:30px;
}
</style>
<script type="text/javascript">
	$(function() {
		 
		//加载  微信 用户组 部门  
		loadJSON($("#usergroup"));
		$("#groupSource #userdep").on("loadok",function(){
			showLoadingToast(false);
		});
		 
		
	
		$("body")
				.on(
						"click",
						".tree_item span",
						function() {
							showLoadingToast(true);
							toNextPageWhenClick();
							//切换到下一页设置下一页标题
							$("#ugrop").html($(this).html());
							var _this = $(this).parent().parent();
							
							//切换到下一页
							//swiper.slideTo(1, 500, false);
						//	$("#ugpage").hide();
							$("#groupSource #userdep").html("");
							 if(true){
	    	 		    			// if(!_this.hasClass("select")){
								$(".tree_item").removeClass("select");
								_this.addClass("select");
								

								var _depid = _this.attr("id").substring(1);//$("#userList").attr("tar").match(/[1-9][0-9]*/g); 

								var items = _this.find(".tree_item.nor");

								var ids = [];
								$.each(items, function() {
									//d+id 去除前缀 d
									 
									ids.push($(this).attr("id").substring(1));
								})
							 if(_this.hasClass("nor"))
								ids.push(_depid);

								//CONETXT_PATH+"/admin/eqpdetail/
								var myDate = new Date()

								$("#groupSource #userdep")
										.load(
												CONETXT_PATH
														+ "/admin/eqpddetail?time="
														+ myDate.getTime(),
												{
													depids : ids.join(",")
												},
												function() {
													 if($("body").hasClass("admin_false"))
				    	 		                  		 $("#groupSource #udepcount").html("("+$("#userdep .level_2").length+"/"+$("#userdep .level_2").length+")");
				    	 		             		 else
				    	 		             		     $("#groupSource #udepcount").html("("+$("#userdep .level_2.online_1").length+"/"+$("#userdep .level_2").length+")");
				    	 		             		 
													 
													
													
													$("#groupSource #userdep")
															.trigger('loadok',
																	"data");

												});

								$
										.ajax({
											type : "POST",
											url : CONETXT_PATH
													+ "/admin/dmembers.do",
											dataType : "html",
											contentType : "application/json",
											data : JSON.stringify(ids),
											success : function(data) {
												//显示保存结果

												$("#groupSource #userlist")
														.html(data);
												$("#groupSource #ucount")
														.html(
																"("
																		+ $("#userlist .item").length
																		+ ")");
												
											}
										});

							}

						});

	});
</script>